<%@page import="com.gxuwz.medical.domain.person.Person"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/base.jsp"%>
<%
	//获取编号参数
	String perscode = request.getParameter("id");
	System.out.println(perscode);
	Person model = new Person(perscode);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/admin.css">
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/admin.js"></script>
<!-- 引入第三方日期JS组件 -->
<script type="text/javascript" src="third/laydate/laydate.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		//重新绑定表单提交
		$("#add_btn").bind("click", function() {
			$('form').submit();
		});
	});
	//选择不同的村组
	function chooseGroup(){
		var val=$("#village").val();
		$.ajax({
			   type: "POST",
			   url: "<%=path%>/system/AreaServlet?m=groupList",
			data : {
				"villageID" : val
			},
			dataType : "json",
			success : function(data) {
				$("#group").empty();
				$.each(data, function(i, val) {
					$("#group").append(
							"<option value='"+val.areacode+"'>" + val.areaname
									+ "</option>");
				});
			}
		});
	}
</script>

</head>

<body>

	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>修改农民档案信息</strong>
		</div>
		<div class="body-content">
			<form id="form-add" method="post"
				action="<%=path%>/system/PersonSerlvet?m=edit">

				<div class="form-x">
					<div class="form-group">
						<div class="label">
							<label>家庭编号：</label>
						</div>
						<div class="field">
							<input type="text" id="famicode" name="famicode"
								value="<%=model.getFamily().getFamicode()%>"
								readonly="readonly" class="input w50" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>成员姓名：</label>
						</div>
						<div class="field">
							<input type="text" id="persname" name="persname"
								value="<%=model.getPersname()%>" class="input w50" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>与户主关系：</label>
						</div>
						<div class="field">
							<select id="relation" name="relation" class="input w50">
							   <option value="1" <%if ("1".equals(model.getRelation())) {%>
									selected="selected" <%}%>>户主本人
								<option>
								<option value="2" <%if ("2".equals(model.getRelation())) {%>
									selected="selected" <%}%>>配偶
								<option>
								<option value="3" <%if ("3".equals(model.getRelation())) {%>
									selected="selected" <%}%>>子女</option>
								<option value="4" <%if ("4".equals(model.getRelation())) {%>
									selected="selected" <%}%>>父母</option>
								<option value="5" <%if ("5".equals(model.getRelation())) {%>
									selected="selected" <%}%>>外甥女</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>身份证号：</label>
						</div>
						<div class="field">
							<input type="text" id="cardID" name="cardID"
								value="<%=model.getCardID()%>" class="input w50" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>出生年月：</label>
						</div>
						<div class="field">
							<input type="text" id="birthday" name="birthday"
								value="<%=model.getBirthday()%>" class="input w50" />
							<div class="tips"></div>
						</div>
					</div>

					<div class="form-group">
						<div class="label">
							<label>性别：</label>
						</div>
						<div class="field">
							<select id="sex" name="sex" class="input w50">

								<option value="1" <%if ("1".equals(model.getSex())) {%>
									selected="selected" <%}%>>男
								<option>
								<option value="2" <%if ("2".equals(model.getSex())) {%>
									selected="selected" <%}%>>女
								<option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>人员属性：</label>
						</div>
						<div class="field">
							<select id="persPro" name="persPro" class="input w50">
								
								<option value="1" <%if ("1".equals(model.getPersPro())) {%>
									selected="selected" <%}%>>一般户
								<option>
								<option value="2" <%if ("2".equals(model.getPersPro())) {%>
									selected="selected" <%}%>>民政救助对象
								<option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>是否农村户口：</label>
						</div>
						<div class="field">
							<select id="isRural" name="isRural" class="input w50">

								<option value="1" <%if ("1".equals(model.isRural())) {%>
									selected="selected" <%}%>>是
								<option>
								<option value="0" <%if ("0".equals(model.isRural())) {%>
									selected="selected" <%}%>>否
								<option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>职业：</label>
						</div>
						<div class="field">
							<select id="occupation" name="occupation" class="input w50">
								<option value="1" <%if ("1".equals(model.getOccupation())) {%>
									selected="selected" <%}%>>农民
								<option>
								<option value="2" <%if ("2".equals(model.getOccupation())) {%>
									selected="selected" <%}%>>工人
								<option>
								<option value="3" <%if ("3".equals(model.getOccupation())) {%>
									selected="selected" <%}%>>学生
								<option>
								<option value="9" <%if ("9".equals(model.getOccupation())) {%>
									selected="selected" <%}%>>其他
								<option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>工作单位：</label>
						</div>
						<div class="field">
							<input type="text" id="workUnit" name="workUnit" value="<%=model.getWorkUnit() %>"
								class="input w50">
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>常住地址：</label>
						</div>
						<div class="field">
							<input type="text" id="liveAddress" name="liveAddress" value="<%=model.getLiveAddress() %>"
								class="input w50">
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>联系电话：</label>
						</div>
						<div class="field">
							<input type="text" id="telephone" name="telephone"
								value="13471402595" class="input w50">
							<div class="tips"></div>
						</div>
					</div>

					<div class="form-group">
						<div class="label">
							<label></label>
						</div>
						<div class="field">
							<button id="add_btn" class="button bg-main icon-check-square-o"
								type="button">提交</button>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
	<!--渲染JS日期组件 -->
	<script type="text/javascript">
 laydate.render({
  elem: '#birthday'
});
</script>
</body>
</html>
